package com.lipiao.nb_iot;

import android.content.Intent;
import android.media.MediaPlayer;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

public class Connect_Activity extends AppCompatActivity {
    public TextView sign;
    public TextView sure;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_connect_);
        init();
    }
    public void init(){
        sign=findViewById(R.id.sign);
        sure=findViewById(R.id.sure);

        sure.setOnClickListener(new OnClick());
    }

    class OnClick implements View.OnClickListener {
        @Override
        public void onClick(View v) {
            switch (v.getId()) {
                case R.id.sure:
                    if(sign.getText().toString().equals("")){
                    Intent intent = new Intent(Connect_Activity.this, MainActivity.class);
                        Toast.makeText(Connect_Activity.this,"标识码正确！",Toast.LENGTH_SHORT).show();
                        startActivity(intent);finish();
                }else{
                        Toast.makeText(Connect_Activity.this,"标识码错误！",Toast.LENGTH_SHORT).show();break;
                }
            }
        }
    }
}
